package com.codi.bus.core.service;

import com.codi.bus.core.domain.InsidePortfolio;
import com.codi.bus.core.domain.Lookup;
import com.codi.bus.core.domain.User;
import com.codi.bus.core.resultModel.AssetsResult;
import com.codi.bus.core.resultModel.BaseResult;
import com.codi.bus.core.resultModel.FundNetValueResult;
import com.codi.bus.core.service.model.*;
import com.codi.bus.exception.BaseException;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Created by asus on 2018/3/9.
 * 查询资产
 */

public interface AssetsQueryService {
     PortfolioModel extractPortfolioForProfit(List<CombSharesQryModel> combSharesQryModels, List<FundNetValueResult> fundNetValueList,
                                                    Map<String, List<DividendModel>> dividendMap,
                                                    List<ConfirmModel> confirms, Long userId, String clientId);

    /**
     * 初始化分红记录
     * @param user
     */
    void initDividents(User user);

    /**
     * 查询总资产
     */
    AssetsResult queryAssets(Long userId) throws BaseException;

    BaseResult insertAssets(AssetsResult assets, Long userId);

    BigDecimal getPortfolioAccumIncomeForProfit(List<ConfirmModel> confirms, List<String> portfolioTradeAccounts, Map<String, List<DividendModel>> dividendMap, Long userId, String clientId);



    AssetFundModel sumOfAsset(List<AssetFundModel> funds, List<Lookup> lookups,
                              boolean needT0, Map<String, BigDecimal> fastRedeemShares, List<DividendModel> dividendModels,
                              List<ConfirmModel> confirms,
                              List<ApplyModel> applyModels, Long userId, String clientId,Set<String> fundCodes);


    List<AssetFundModel> extractFunds(List<ShareModel> shares, List<Lookup> lookups,
                                      List<FundNetValueResult> fundNetValueList, Set<String> fundCodes);

    void getInsidePortfolio(User user, Boolean flag);

    void getPortfolioTradeAccount(User user);

    void getPortfolioAssets(User user);

    List<InsidePortfolio> getMobile();

    void dividendTest(User user, int i);
}
